# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qt6-qttools
pkgver=6.3.1
pkgrel=0
pkgdesc="A cross-platform application and UI framework (Development Tools, QtHelp)"
url="https://qt.io/"
arch="all"
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only AND Qt-GPL-exception-1.0"
depends_dev="
	qt6-qtdeclarative-dev
	vulkan-headers
	"
makedepends="$depends_dev
	cmake
	perl
	samurai
	"
# clang-dev, clang-static, llvm12-dev and llvm12-static are required for qtdoc to be built
subpackages="$pkgname-dev"
options="!check" # No tests
builddir="$srcdir/qttools-everywhere-src-${pkgver/_/-}"

case $pkgver in
	*_alpha*|*_beta*|*_rc*) _rel=development_releases;;
	*) _rel=official_releases;;
esac

source="https://download.qt.io/$_rel/qt/${pkgver%.*}/${pkgver/_/-}/submodules/qttools-everywhere-src-${pkgver/_/-}.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6e392ef2415b14119d0c4058efa78f1a66e91c01c8f48a2f1926df43f7f1cb8fcd94f84c91fc0188baa96e3055eede6f080ca4e9f150e263c3fdc5c864649883  qttools-everywhere-src-6.3.1.tar.xz
"
